import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import '@/common/js/rem'
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import FastClick from 'fastclick'
import Vant from 'vant'
import VueLazyload from 'vue-lazyload'
import VueClipboard from 'vue-clipboard2'
import 'vant/lib/vant-css/index.css'
import 'vant/lib/vant-css/icon-local.css'
import '@/styles/index.scss'
import * as filters from './filters'

FastClick.attach(document.body)
Vue.use(Vant)
Vue.use(VueLazyload)
Vue.use(VueClipboard)
Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
    next()
})

router.afterEach((to) => {

})

Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

/* eslint-disable no-new */
const vue = new Vue({
    el: '#app',
    router,
    store,
    components: { App },
    template: '<App/>'
})

vue.$toast.setDefaultOptions({
    duration: 2000
})

export default vue